package com.ft.javaio.aio;


import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.AsynchronousSocketChannel;
import java.nio.charset.Charset;
import java.util.concurrent.Future;

/**
 * @Author RenPu
 * @Date 2022/10/12 9:35
 * @Version 1.0
 * @Description:
 **/
public class AIoClient {


    public static void main(String[] args) throws Exception {
        AsynchronousSocketChannel socketChannel  = AsynchronousSocketChannel.open();
        Future<Void> future = socketChannel.connect(new InetSocketAddress("127.0.0.1", 7397));
        System.out.println("AIO demo client .....................");
        future.get();

//        socketChannel.read(ByteBuffer.allocate(1024), null, new AioClientHandler(socketChannel, Charset.forName("GBK")));



    }
}
